package tech.eyao.hs60x.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import tech.eyao.hs60x.model.domain.ApprovalDO;
import tech.eyao.hs60x.vo.ApprovalPageQuery;

public interface ApprovalDOMapper {
    int deleteByPrimaryKey(Long id);

    int insert(ApprovalDO record);

    ApprovalDO selectByPrimaryKey(Long id);

    int updateByPrimaryKey(ApprovalDO record);

    /**
     * 分页查询
     * 
     * @param pageQuery
     * @return
     */
    List<ApprovalDO> getListByPage(ApprovalPageQuery pageQuery);

    /**
     * 是否已经存在申请记录
     * 
     * @param watchId
     * @param userId
     * @return
     */
    ApprovalDO isHas(@Param("watchId") Long watchId, @Param("friendId") Long userId, @Param("status") int status);

    /**
     * 删除
     * 
     * @param userId
     * @param watchId
     * @return
     */
    public void deleteByOwnIdAndWatchId(@Param("userId") long userId, @Param("watchId") Long watchId);
    
    /**
     * 根据消息主键获取审批消息列表（不分页）
     * @param userId
     * @param watchId
     * @return
     */
    List<ApprovalDO> getListByCondition(@Param("userId") Long userId, @Param("watchId") Long watchId);
}
